package com.yidu.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Service;

import com.yidu.bean.TbRoleModule;
import com.yidu.dao.TbRoleModuleMapper;
import com.yidu.message.Page;
import com.yidu.service.TbRoleModuleService;

/**
 * 类的描述--
 * @author 楠竹
 * @date 2018年7月25日
 * @version 1.0
 */
@Service
public class TbRoleModuleServiceImpl implements TbRoleModuleService {

	Logger logger = Logger.getLogger(TbRoleModuleServiceImpl.class);
	
	@Resource
	private TbRoleModuleMapper roleModuleDao;
	/* (non-Javadoc)
	 * @see com.yidu.service.TbRoleModuleService#delete(java.lang.String)
	 */
	@Override
	public int delete(String rmId) {
		logger.info("进入删除...");
		int num  = roleModuleDao.deleteByPrimaryKey(rmId);
		return num;
	}

	/* (non-Javadoc)
	 * @see com.yidu.service.TbRoleModuleService#deleteMod(java.lang.String)
	 */
	@Override
	public int deleteMod(String roleId) {
		logger.info("进入删除...");
		int num  = roleModuleDao.delete(roleId);
		return num;
	}

	/* (non-Javadoc)
	 * @see com.yidu.service.TbRoleModuleService#save(com.yidu.bean.TbRoleModule)
	 */
	@Override
	public int save(TbRoleModule rm) {
		logger.info("进入删除...");
		int num  = roleModuleDao.insertSelective(rm);
		return num;
	}

	/* (non-Javadoc)
	 * @see com.yidu.service.TbRoleModuleService#update(com.yidu.bean.TbRoleModule)
	 */
	@Override
	public int update(TbRoleModule rm) {
		logger.info("进入删除...");
		int num  = roleModuleDao.updateByPrimaryKey(rm);
		return num;
	}

	/* (non-Javadoc)
	 * @see com.yidu.service.TbRoleModuleService#findVague(com.yidu.message.Page, com.yidu.bean.TbRoleModule)
	 */
	@Override
	public List<TbRoleModule> findVague(Page page, TbRoleModule rm) {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see com.yidu.service.TbRoleModuleService#findModule(java.lang.String)
	 */
	@Override
	public List<TbRoleModule> findModule(String roleId) {
		logger.info("进入删除...");
		List<TbRoleModule> num  = roleModuleDao.findModule(roleId);
		return num; 
	}

}
